<?php include_once './application/views/sys_admin/common/header.php';  ?>
<div class=" definewidth m20">
		<form  class="form-inline definewidth m20">
  			<button type="button" class="btn btn-success"  onclick="href('/sys_admin/conset/add_subject_view/');" >添加审核科目库</button>
  		</form>
		<table class="table table-bordered table-hover definewidth m10">
			 <thead>
			    <tr>
			        <th><strong>序号</strong></th>
			        <th><strong>编号</strong></th>
					<th><strong>名称</strong></th>
					<th><strong>有效期</strong></th>
					<th><strong>创建时间</strong></th>
					<th><strong>操作</strong></th>
			    </tr>
			   </thead>
			  <?php foreach($conset_list as $key=>$conset){?>
			  <tr id="row_<?php echo $conset['id'];?>">
				<td><?php echo $conset['id'];?></td>
				<td><?php echo $conset['id'];?></td>
				<td><?php echo $conset['title'];?></td>
				<td><?php echo $conset['valid'];?>个月</td>
				<td><?php echo date('Y-m-d H:i',$conset['add_time']);?></td>
				<td>
				<a href="/sys_admin/conset/edit_subject_view/<?php echo $conset['id'];?>">编辑</a>
				<a href="javascript:if(confirm('确定删除审核科目库？')){remove(<?php echo $conset['id'];?>);}">删除</a>
				</td>
			  </tr>
			  <?php }?>
			  	<tr>
			  	<td colspan="8"  class="page"><?php echo $this->pagination->create_links();?></td>
			  	</tr>
		</table>
</div>
<script type="text/javascript">
function remove(id){
	$.ajax({
		type: "post",
		url: "/sys_admin/conset/remove_subject/",
		data: "id="+id,
		success: function(msg){
			$("#dialog" ).dialog();
			if(msg == 1){
				$("#msg").html("删除成功！");
				$("#row_"+id).hide();
			}else{
				$("#msg").html("删除失败，请联系管理员！");
			}
			setTimeout(function(){
				$("#dialog" ).dialog("close");
			},3000);
		},
		dataType: "text"
	});
}	
</script>
	<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>	
